package com.tyl.arrray;

public class Person {
    private  String username;
    public Person(){
        this("1zhangsan");//不在首行则、报错
        method("2lisi");//构造方法调用其他构造方法时，this必须在首行
    }
    public Person(String username){
        this.username=username;
    }
    public  void method(String username){
        System.out.printf(username); //先lisi再zhangsan
        System.out.println("======");
        System.out.println(this.username);
    }
    public  void method2(){
        System.out.println("==============");
        this.method("李四");//普通方法则不需要this在首行
    }
    public static void main(String[] args) {
        Person person1=new Person();
        Person person2=new Person();
//        System.out.println(person1);
//        person1.method2();
//        person2.method2();
    }
}
